@(announcements: List[models.domain.Announcements], teacherCourses: List[models.general.vKennariHoparOnn])

@teacherMain(title = "Allar tilkynningar") {
    <link rel="stylesheet" href="/public/stylesheets/eams.css">

    <div class="container conLower">
        <div class="row">
            <div class="span12">
                <h2>Allar tilkynningar</h2>
                <p style="text-align:right"><a href="#myModal" class="btn btn-primary" data-toggle="modal"><i class="icon-white icon-edit"></i> Búa til nýja tilkynningu </a> </p>
                        @for(announcement <- announcements){
                            <div class="well well-small">
                                <p class="underScore11pt">@announcement.dagur_stofnad &nbsp;&nbsp;@announcement.namsgrein_afanganr
                                    <span style="float: right">
                                        <a class="btn" href="@routes.TeacherController.deleteAnnouncement(announcement.id)" title="Eyða tilkynningu"><i class="icon-trash"></i></a>
                                    </span>
                                </p>
                                <p class="bold12pt">@announcement.fyrirsogn</p>
                                <p class="reg11pt">@announcement.texti</p>
                            </div>
                        }
            </div>
        </div>
    </div>

    <!--Modal -->
    <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="myModalLabel">Setja inn nýja tilkynningu</h3>
        </div>
        @helper.form(action = routes.TeacherController.uploadAnnouncements(1)){
            <div class="modal-body">
                <div class="control-group">
                    <label class="control-label"> Áfangi </label>
                    <div class="controls">
                        <select class="input-xlarge" name="afangi_id">
                            <option value="0">Birta fyrir allan skólann</option>
                            @for(course <- teacherCourses){
                                <option value=@{course.afangi_id}>@{course.namsgrein_afanganr}</option>
                            }
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label"> Fyrirsögn </label>
                    <div class="controls">
                        <input class="input-xlarge" name="fyrirsogn">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label"> Tilkynning </label>
                    <div class="controls">
                        <textarea class="input-xxlarge" name="texti"></textarea>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary" value="submit">Vista tilkynningu</button>
                <button class="btn" data-dismiss="modal" aria-hidden="true">Hætta við</button>
            </div>
        }
    </div>
    <!--End of modal-->

}
